package com.zjuh.qss.biz.misc;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.SchedulerException;
import org.springframework.context.ApplicationContext;

import com.zjuh.qss.biz.ao.WorkerAO;

public class DumpRatesJob implements Job {

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		try {
			ApplicationContext applicationContext = (ApplicationContext)context.getScheduler().getContext().get("applicationContext");
			WorkerAO worker = (WorkerAO)applicationContext.getBean("workerAO");
			worker.runUpdateRates();
		} catch (SchedulerException e) {
			throw new JobExecutionException(e);
		}
	}

}
